package org.example.shejimoshi.create.shengchengqi;

public class Director {
   
    private ComputerBuilder computerBuilder;
    public void setComputerBuilder(ComputerBuilder computerBuilder) {
        this.computerBuilder = computerBuilder;
    }
   
    public Computer getComputer() {
        return computerBuilder.getComputer();
    }
   
    public void constructComputer() {
        computerBuilder.buildComputer();
        computerBuilder.buildMaster();
        computerBuilder.buildScreen();
        computerBuilder.buildKeyboard();
        computerBuilder.buildMouse();
        computerBuilder.buildAudio();
    }


    public static void main(String[] args) {


        Director director = new Director();
        director.setComputerBuilder(new HPComputerBuilder());

        Computer computer = director.getComputer();
        System.out.println(computer);


    }
}